<template>
  <div class="out">
    <p class="title">
      <span>{{ data.title }}</span>
      <span @click="goMore(data.activityId)">更多&gt;</span>
    </p>
    <ul class="main">
      <li v-for="v in data.groupList[0].dealList" :key="v.dealId" @click="goDetail(v)">
        <img :src="v.dealPhoto" alt="" />
        <div>{{ v.dealName }}</div>
        <p>￥{{ v.dealPrice }}</p>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ['data'],
  methods: {
    goMore(id) {
      this.$router.push({ name: 'storeMore', query: { id } });
    },
    goDetail(v) {
      this.$router.push({ name: 'storeDetail', query: { name: v.dealName, img: v.dealPhoto, price: v.dealPrice } });
    },
  },
};
</script>

<style lang="less" scoped>
.out {
  border-radius: 0.65rem;
  width: 100%;
  overflow: hidden;
  padding: 0;
  margin: 0.2rem 0;
  .title {
    background-color: #f6f4ff;
    height: 0.8rem;
    line-height: 0.8rem;
    box-sizing: border-box;
    padding: 0 0.35rem;
    span {
      &:first-of-type {
        font-size: 0.3rem;
        float: left;
      }
      &:last-of-type {
        font-size: 0.2rem;
        float: right;
        color: #999;
      }
    }
  }
  .main {
    box-sizing: border-box;
    padding: 0.3rem;
    display: flex;
    justify-content: space-between;
    background-color: #ffffff;
    li {
      width: 2rem;
      box-sizing: border-box;
      border-radius: 0.1rem;
      overflow: hidden;
      font-size: 0.28rem;
      border: 1px solid #ddd;
      padding-bottom: 0.1rem;
      img {
        width: 100%;
        height: 2rem;
      }
      div {
        padding: 0.05rem;
        height: 0.9rem;
        box-sizing: border-box;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
      }
      p {
        padding: 0.05rem;
        box-sizing: border-box;
        color: red;
      }
    }
  }
}
</style>
